package com.by.service.impl;

import com.by.mapper.DictMapper;
import com.by.pojo.entity.Dict;
import com.by.service.DictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DictServiceImpl implements DictService {

    private final DictMapper dictMapper;

    @Autowired
    public DictServiceImpl(DictMapper dictMapper) {
        this.dictMapper = dictMapper;
    }


    @Override
    public int save(Dict dict) {
        return dictMapper.save(dict);
    }

    @Override
    public List<Dict> selectByPid(Integer pid) {
        List<Dict> list = dictMapper.selectByPid(pid);
        return list;
    }

    @Override
    public int update(Dict dict) {
        return dictMapper.update(dict);
    }

    @Override
    public int delete(Integer id) {
        return dictMapper.delete(id);
    }
}

